package com.itheima.leyou.controller;

import com.itheima.leyou.service.AuthService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/auth")
public class AuthController {
    @Autowired
    private AuthService authService;
    /**
     * 校验服务端校验token时发送过来的clientId和secret
     * @param clientId=user-servie
     * @param secret 1234密码
     * @return
     */
    @GetMapping("/client")
    public ResponseEntity<String> checkClient(
            @RequestParam("clientId")String clientId,
            @RequestParam("secret")String secret){
        return ResponseEntity.ok(authService.checkClient(clientId,secret));
    }
}
